export const getImage = (url: string)=> {
  return new URL(`../assets/image/${url}`, import.meta.url).href;
}

export const recoverData = (oldData:any,newData:any) => {
  type oldDataType = keyof typeof oldData
  Object.keys(oldData).forEach(key =>{
    if(newData[key]){
      oldData[key as oldDataType] = newData[key]
    }
  })
}